package users

import (
	"context"

	"shenmawl/api/user/v1"
)

func (c *ControllerV1) GetOneUserInfo(ctx context.Context, req *v1.GetOneUserInfoReq) (res *v1.GetOneUserInfoRes, err error) {
	userInfo, err := c.users.UserInfo(ctx)

	return &v1.GetOneUserInfoRes{
		Username:    userInfo.UserName,
		NickName:    userInfo.NickName,
		DeptId:      userInfo.DeptId,
		PhoneNumber: userInfo.Phonenumber,
		Email:       userInfo.Email,
		CreatedAt:   userInfo.CreateTime,
		LoginAt:     userInfo.LoginDate,
	}, nil
}
